package com.maxd.modules.selfshop.prize.respository;


import com.maxd.modules.selfshop.prize.entity.SelfPrize;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SelfPrizeJpaRepository extends JpaRepository<SelfPrize, Long> {

    //条件查询带分页
    Page<SelfPrize> findAll(Specification<SelfPrize> specification, Pageable pageable);

    //条件查询
    List<SelfPrize> findAll(Specification<SelfPrize> specification);

    //奖池对应奖品
    List<SelfPrize> findAllByPrizeRuleId(Long prizeRuleId);

}
